import { VuexModule, Module, Action, getModule } from 'vuex-module-decorators'
import { getSignInfo } from '@/api/sign'
import store from '@/store'

export interface ISignState {

}

@Module({ dynamic: true, store, name: 'Sign' })
class Sign extends VuexModule implements ISignState {

    @Action
    public async getSignInfo(idCard: string) {
        return new Promise((r: any, j: any) => {
            getSignInfo({ idCard: idCard }).then((value: any) => {
                console.error("Sign:", value)
                r(value.data)
            }).catch(ex => {
                console.error(ex);
                j([])
            })
        })
    }
}

export const SignModule = getModule(Sign)
